import type { AppRouteModule } from '/@/router/types';

import { LAYOUT } from '/@/router/constant';
import { t } from '/@/hooks/web/useI18n';

const ERP: AppRouteModule = {
  path: '/erp',
  name: 'ERP',
  component: LAYOUT,
  redirect: '/erp/order',
  meta: {
    orderNo: 2,
    icon: 'material-symbols:backup-table-sharp',
    title: t('routes.erp.erp'),
  },
  children: [
    {
      path: 'order',
      name: 'Order',
      component: () => import('/@/views/ERP/procurement/order/index.vue'),
      meta: {
        title: t('routes.erp.order'),
      },
    },
    {
      path: 'sell',
      name: 'Sell',
      component: () => import('/@/views/ERP/sell/order/index.vue'),
      meta: {
        title: t('routes.erp.sellOrder'),
      },
    },
    {
      path: 'Product',
      name: 'Product',
      meta: {
        title: t('routes.erp.Product'),
      },
      children: [
        {
          path: 'commodity',
          name: 'commodity',
          component: () => import('/@/views/ERP/commodity/index.vue'),
          meta: {
            title: t('routes.erp.commodity'),
          },
        },
        {
          path: 'ProductCategory',
          name: 'ProductCategory',
          component: () => import('/@/views/ERP/ProductCategory/index.vue'),
          meta: {
            title: t('routes.erp.ProductCategory'),
          },
        },
        {
          path: 'productAttributes',
          name: 'productAttributes',
          component: () => import('/@/views/ERP/productAttributes/index.vue'),
          meta: {
            title: t('routes.erp.productAttributes'),
          },
        },{
          path: 'commodityUnits',
          name: 'commodityUnits',
          component: () => import('/@/views/ERP/commodityUnits/index.vue'),
          meta: {
            title: t('routes.erp.commodityUnits'),
          },
        },
      ],
    },
    {
      path: 'supplier',
      name: 'Supplier',
      component: () => import('/@/views/ERP/supplier/index.vue'),
      meta: {
        title: t('routes.erp.supplier'),
      },
    },
    {
      path: '/inventory',
      name: 'inventory',
      meta: {
        title: t('routes.erp.inventory'),
      },
      children: [
        {
          path: 'query',
          name: 'Query',
          component: () => import('/@/views/ERP/inventory/inventory_query/index.vue'),
          meta: {
            title: t('routes.erp.query'),
          },
        },
        {
          path: 'stocktaking',
          name: 'Stocktaking',
          component: () => import('/@/views/ERP/inventory/stocktaking/index.vue'),
          meta: {
            title: t('routes.erp.stocktaking'),
          },
        },
        {
          path: 'warehousing',
          name: 'Warehousing',
          component: () => import('/@/views/ERP/inventory/warehousing/index.vue'),
          meta: {
            title: t('routes.erp.warehousing'),
          },
        },
        {
          path: 'outbound',
          name: 'Outbound',
          component: () => import('/@/views/ERP/inventory/outbound/index.vue'),
          meta: {
            title: t('routes.erp.outbound'),
          },
        },
      ],
    },
  ],
};

export default ERP;
